const Character = require('../bases/Character');
const Equipment = require('../bases/Equipment');
const { games, tool } = require('./create');
const lowdb = require('../data/createLow');
const init = module.exports = () => {
    games.setYMD('开元二', '十', '三十');
    games.tiledImg = tool.imgData;
    let tiledarr = [
        // square 瓦块124*154 diff.h:18
        // evelen 瓦块80*80
    ];
    let roadnames = [];
    for (let i = 0; i < 3; i++) {
        for (let j = 0; j < 4; j++) {
            tiledarr.push({ w: 80, h: 80, x: 80 * j, y: 80 * i, name: `road${j + i * 4}`, type: 'road' })
            roadnames.push(`road${j + i * 4}`);
        }
    }

    let sword = new Equipment('神剑', 'godSword', tool.sword, 'arms');
    sword.isDisplay = true;
    sword.weight = 10;
    sword.attack = [20, 40];
    games.sword = sword;
    let npc = new Character('爱丽丝', tool.imgData.npc, { x: 296, y: 60, width: 248, height: 252 });
    npc.level = 12;
    npc.sex = '女性';
    npc.age = 16;
    npc.faith = '';
    npc.addGoods(sword, 2);
    npc.xp = 1000;
    npc.nextXp = 9999;
    games.npc = npc;
    lowdb.role.set('npc', npc).write();
}